<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;

/**
 * 视频插入插件
 *
 * @package VideoInsertion
 * @author player
 * @version 1.0.0
 * @link 
 */
class VideoInsertion_Plugin implements Typecho_Plugin_Interface
{

    /**
     * 激活插件方法,如果激活失败,直接抛出异常
     *
     * @access public
     * @return void
     */
    public static function activate()
    {
        Typecho_Plugin::factory('admin/write-post.php')->bottom = ['VideoInsertion_Plugin', 'addEditorButton'];
        Typecho_Plugin::factory('admin/write-page.php')->bottom = ['VideoInsertion_Plugin', 'addEditorButton'];
    }

    /**
     * 禁用插件方法,如果禁用失败,直接抛出异常
     *
     * @static
     * @access public
     * @return void
     */
    public static function deactivate()
    {
    }
/**
 * 给编辑页面新增插入视频按钮
 */

    public static function addEditorButton()
    {
        $dir = Helper::options()->pluginUrl . '/VideoInsertion/assets/editor.js';
        echo "<script type=\"text/javascript\" src=\"{$dir}\"></script>";
    }

    public static function config(Typecho_Widget_Helper_Form $form)
    {

    }
/**
 * 配置页面
 *
 * @param Typecho_Widget_Helper_Form $form
 * @return void
 */
    public static function personalConfig(Typecho_Widget_Helper_Form $form)
    {
    }
}
